package io.github.wanggit.antrpc.gateway.configuration;

import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "gw")
public class GatewayProperties {

    @Getter public final Zk zk = new Zk();

    @Data
    public static class Zk {
        private String hosts = "localhost:2181";
        /** zookeeper连接断开之后进行重试的基础等待时间毫秒 */
        private Integer zkConnectRetryBaseSleepMs = 1000;

        /** zookeeper连接断开之后重试的最大次数 */
        private Integer zkConnectMaxRetries = 5;

        /** zookeeper连接断开之后进行重试的最大等待时间毫秒 */
        private Integer zkConnectRetryMaxSleepMs = 30000;

        /** zookeeper连接超时时间毫秒 */
        private Integer zkConnectionTimeoutMs = 5000;
    }
}
